package com.example.demo.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.demo.dao.GridCityDao;
import com.example.demo.pojo.GridCity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Primary
public class GridCityServiceImpl implements IGridCityService {

    @Autowired
    private GridCityDao gridCityDao;

    @Override
    public List<GridCity> listGridCityByProvinceId(Integer provinceId) {
        QueryWrapper<GridCity> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("province_id", provinceId);
        return gridCityDao.selectList(queryWrapper);
    }
}
